package cn.com.ejiakanghu.dto;

import org.linlinjava.litemall.db.vo.app.AgedmallPartsVo;
import org.linlinjava.litemall.db.vo.app.LitemallGoodsProductVo;

public class GoodsCustomSpecItemInfo {

    /**
     * 门店商品id
     */
    private int id;

    /**
     * 规格名称，例如：鼻吸、坐垫、10万重大疾病险、上门就诊
     */
    private String name;

    /**
     * 规格图片URL，图片宽高尺寸比例320x320
     */
    private String image;

    /**
     * 规格价格，该价格直接与商品价格相加
     */
    private double price;

    /**
     * 规格剩余库存数量
     */
    private int stock;

    private GoodsSku goodsSku;

    public static GoodsCustomSpecItemInfo getInstance(AgedmallPartsVo agedmallPartsVo, GoodsSku goodsSku, Integer stock) {
        GoodsCustomSpecItemInfo goodsCustomSpecItemInfo = new GoodsCustomSpecItemInfo();
        goodsCustomSpecItemInfo.setId(agedmallPartsVo.getId());
        goodsCustomSpecItemInfo.setName(agedmallPartsVo.getName());
        goodsCustomSpecItemInfo.setImage(agedmallPartsVo.getUrl());
        goodsCustomSpecItemInfo.setGoodsSku(goodsSku);
        if(null != stock){
            goodsCustomSpecItemInfo.setStock(stock);
        }
        return goodsCustomSpecItemInfo;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public GoodsSku getGoodsSku() {
        return goodsSku;
    }

    public void setGoodsSku(GoodsSku goodsSku) {
        this.goodsSku = goodsSku;
    }
}
